package com.hashbee.user.controller;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import com.hashbee.bo.ReturnData;
import com.hashbee.ctxinit.Audience;
import com.hashbee.user.domain.User;
import com.hashbee.user.model.UserVo;
import com.hashbee.user.service.UserService;
import com.hashbee.util.JwtUtils;

import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;


@RestController
@RequestMapping(value = "user")
public class UserController {

    @Autowired
    private UserService userService;
    

    @RequestMapping(value="/auth/login", method=RequestMethod.POST)
    public ReturnData<User> login(@RequestBody UserVo userVo) throws Exception{ 	
    	ReturnData<User> user = userService.login(userVo);
        return user; 
    }


}
